package net.lc7.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @Description:
 * @Author: Jason.zhu
 * @Create: 2019/05/22 17:49
 */

public class ZkPropertiesUtil {

    private static Properties zkProperties = new Properties();

    static {

        InputStream is = ZkPropertiesUtil.class.getResourceAsStream("/zk.properties");
        try {
            zkProperties.load(is);
        } catch (Exception e) {
            e.printStackTrace();
        }finally {
            try {
                if (is != null) {
                    is.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    public static String getZkServerIp(){
        return zkProperties.getProperty("zk.zkServerIps");
    }

    public static int getZktimeout(){
        return Integer.valueOf(zkProperties.getProperty("zk.timeout"));
    }

    public static void main(String[] args) {
       String source = "0101888";

        System.out.println(source.substring(0, source.length() - 2));
    }
}
